package com.example.myapp_iphoneicon;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.widget.ImageView;

public class ipicon extends ImageView{
    
    public static final int SHADOW_DOCKBAR_ICON = 2;
    public static final int SHADOW_NONE = 0;
    public static final int SHADOW_WALLPAPER_ICON = 1;

    public ipicon(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        // TODO Auto-generated constructor stub
    }

    public ipicon(Context context, AttributeSet attrs) {
        super(context, attrs);
        // TODO Auto-generated constructor stub
    }

    public ipicon(Context context) {
        super(context);
        // TODO Auto-generated constructor stub
    }
    

    
    public void drawShadow(LayoutCalculator lc, Canvas cv,
            int left, int top, int shadowType) {
        Bitmap bitmapShadow;// v0
        switch (shadowType) {
        case SHADOW_WALLPAPER_ICON:
            bitmapShadow = BitmapManager.getWallpaperIconShadow(getContext());//op.getWallpaperIconShadow();
            int shadowLeft = left + (lc.mIconWidth - bitmapShadow.getWidth())
                    / 2;// v1
            int shadowTop = lc.mIconHeight + top - lc.dpToPixel(16)
                    - bitmapShadow.getHeight() / 2;// v2
            cv.drawBitmap(bitmapShadow, (float) shadowLeft, (float) shadowTop,
                    null);
            break;
        case SHADOW_DOCKBAR_ICON:
            bitmapShadow = BitmapManager.getDockbarIconShadow(getContext());//op.getDockbarIconShadow();
            cv.drawBitmap(bitmapShadow, (float) left, (float) top, null);
            break;
        }
    }

/*    public void drawIcon(LayoutCalculator paramLayoutCalculator, Canvas paramCanvas, int paramInt1,
            int paramInt2, Paint paramPaint, int paramInt3) {
        Bitmap localBitmapOne = mIcon;
        if (localBitmapOne == null)
            return;
        Bitmap localBitmapTwo = mNotification;
        ApplicationInfo localApplicationInfo = this;
        LayoutCalculator localLayoutCalculator = paramLayoutCalculator;
        ObjectPool localObjectPool = paramObjectPool;
        Canvas localCanvas = paramCanvas;
        localApplicationInfo.drawShadow(localLayoutCalculator, localObjectPool,
                localCanvas, paramInt1, paramInt2, paramInt3);
        Paint localPaintOne = paramPaint;
        paramCanvas.drawBitmap(localBitmapOne, paramInt1, paramInt2,
                localPaintOne);
        if (localBitmapTwo == null)
            return;
        int marginRight = paramLayoutCalculator.mRcMarginRight;
        int left = paramLayoutCalculator.getIconWidth() + paramInt1
                - localBitmapTwo.getWidth() + marginRight;
        int marginTop = paramLayoutCalculator.mRcMarginTop;
        int top = paramInt2 - marginTop;
        Paint localPaintTwo = paramPaint;
        paramCanvas.drawBitmap(localBitmapTwo, left, top, localPaintTwo);
    }*/
    
    @Override
    protected void onDraw(Canvas canvas) {
        // TODO Auto-generated method stub
        
//        localApplicationInfo.drawIcon(localLayoutCalculator, localObjectPool,
//                localCanvas, localRect.left, localRect.top, null, 0);
        
        super.onDraw(canvas);
    }

    
    
}
